package com.cskaoyan.wordmemorize.controller.admin;

import com.cskaoyan.wordmemorize.auth.SaAdminCheckPermission;
import com.cskaoyan.wordmemorize.common.result.Result;
import com.cskaoyan.wordmemorize.dao.mapper.OperateLogMapper;
import com.cskaoyan.wordmemorize.dto.admin.OperateLogDTO;
import com.cskaoyan.wordmemorize.dto.admin.PageDTO;
import com.cskaoyan.wordmemorize.request.OperateLogPageRequest;
import com.cskaoyan.wordmemorize.service.AdminLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/log")
public class AdminLogController {
    @Autowired
    AdminLogService adminLogService;

    // todo:查询系统操作日志
    @SaAdminCheckPermission("admin:log:search")
    @GetMapping("operation/list")
    public Result<PageDTO<OperateLogDTO>> getOperateLogPage(OperateLogPageRequest operateLogPageRequest) {
        PageDTO<OperateLogDTO> operateLogPage = adminLogService.getOperateLogPage(operateLogPageRequest);
        return Result.ok(operateLogPage);
    }
}
